from snownlp import SnowNLP
from load_data import get_data
import pandas as pd
from sklearn.metrics import classification_report


def main():
    data = get_data('val')
    pred = []
    for article in data['title'].tolist():
        pred.append(1 if SnowNLP(article).sentiments > 0.8 else 0)

    labels = [0 if _ < 0 else 1 for _ in data['emotion'].tolist()]
    print(classification_report(labels, pred))


if __name__ == '__main__':
    main()
